package com.tencent.wxcloudrun.vpnmanagement.tools;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器配置
 *
 */

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    AuthenticationFilter authenticationFilter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(commonInterCepter()).addPathPatterns("/**");
        registry.addInterceptor(authenticationFilter)
                .addPathPatterns("/**")
                .excludePathPatterns("/api/getopenid","/api/getauth");
//                .excludePathPatterns("/h5/oauthUrl");

        //"/contact/*",
//        registry.addInterceptor(h5LoginIntercepter()).addPathPatterns("/*/pri/*","/extcontact/*","/message/*","/media/*","/oa/*","/school/*")
//        .excludePathPatterns("/h5","/message/sendtext","/h5/index","/front/oauth","/school/oauth_callback","/contact/*");

        WebMvcConfigurer.super.addInterceptors(registry);
    }



}
